import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    get UserToken(){
      return localStorage.getItem('token');
    },
    set UserToken(value){
      localStorage.setItem('token',value)
    },
    get isLogin(){
      return localStorage.getItem('isLogin');
    },
    set isLogin(value){
      localStorage.setItem('isLogin',value)
    },
    
  },
  mutations: {
    LOGIN_IN(state,token){
      state.UserToken=token
    },
    LOGIN_OUT(state){
      state.UserToken = ""
    },
    setIsLogin(state,cs){
      state.isLogin=cs
    }

  },
  actions: {
  },
  modules: {
  }
})
